#ifndef PID_H
#define PID_H
#include "Type_define.h"


	
typedef struct 
{ 	
  s16 KP;
  s16 KI;
	s16 KD;
  s32 LowerLimitOutput;     //Lower Limit for Output limitation
  s32 UpperLimitOutput;     //Lower Limit for Output limitation
  s32 LowerLimitIntegral;   //Lower Limit for Integral term limitation
  s32 UpperLimitIntegral;   //Lower Limit for Integral term limitation
  s32 PIOut;
  s32 SUM;
	s32 LastError;
} PID_Components;



 extern PID_Components PID_ID;  
 extern PID_Components PID_IQ;
 extern PID_Components PID_SPEED;


void PIDIQResumeFun(s32 ResumeVal);
void PIDParameterResetFun(void);
void PIDParameterInitFun(void);
void PidUpdateFun(void);
s32 PidCalFun(PID_Components *PID_Struct,s32 hReference, s32 hPresentFeedback);


#endif


